home *** CD-ROM | disk | FTP | other *** search
/ Black Crawling Systems Archive Release 1.0 / Black Crawling Systems Archive Release 1.0 (L0pht Heavy Industries, Inc.)(1997).ISO / blackcrwl / encrypt / RITTER-C.TXT < prev    next >
Internet Message Format  |  1996-06-08  |  14KB

  1. Path: msuinfo!midway!ncar!elroy.jpl.nasa.gov!usc!cs.utexas.edu!peyote!ritter
  2. From: ritter@peyote.cactus.org (Terry Ritter)
  3. Newsgroups: sci.crypt
  4. Subject: Design of Cryptosystem CLOAK
  5. Keywords: cipher dynamic substitution additive RNG cloak
  6. Message-ID: <3492@peyote.cactus.org>
  7. Date: 16 Nov 90 21:32:32 GMT
  8. Distribution: usa
  9. Organization: Capital Area Central Texas Unix Society, Austin, TX
  10. Lines: 294
  11.  
  12.  
  13.      Apparently something went wrong with the first post -- if this
  14. is a duplicate, sorry!
  15.  
  16.  
  17.       If you found the source for the CLOAK cipher a bit much, or
  18. even irritating, you are not alone.  Gee, folks, I just don't use
  19. C much; I prefer Turbo Pascal.  A short "theory" document was
  20. included in the distribution file CLOAK.ZIP which is on many
  21. bulletin boards.  But I was worried about message length, and did
  22. not include it in the CLOAK posting here.  
  23.  
  24.       Basically, CLOAK is a stream cipher, with an improved and non-
  25. linear combiner design (instead of the usual linear exclusive-OR),
  26. and an improved Random Number Generator (with up to 44K of internal
  27. state).  The sequence of operations is approximately as follows:  
  28.  
  29.       * A textual User Key is processed into 992 bits
  30.       * The User Key bits initialize a large RNG
  31.       * The RNG is extended
  32.       * A 992-bit "really random" Message Key is created
  33.       * The RNG is used to XOR-cipher the Message Key
  34.       * The plaintext Message Key re-inits the RNG
  35.       * The RNG is extended to operational length 
  36.       * The RNG is used to init the Dynamic Substitution tables
  37.       * The RNG and Dynamic Substitution encipher plaintext data
  38.  
  39.       Since an enciphered Message Key is added to every enciphered
  40. file anyway, additional header information is also added.  This
  41. includes a flag to indicate "enciphered," and values which indicate
  42. the cipher technique being used.  In this way, the design can be
  43. extended in the future, and yet still remain compatible with
  44. existing enciphered files.  
  45.  
  46.       The cryptographic RNG is an Additive design, which is based on
  47. some arbitrary primitive mod 2 polynomial; GFSR designs using
  48. trinomials of degree 521 have been reported.  The CLOAK RNG uses
  49. particular primitive 9-nomials found by the author, and includes a
  50. selection between degrees 1279, 4253, and 11213 when enciphering. 
  51. This is a very big RNG.  
  52.  
  53.       Should you wish to work on breaking CLOAK, please first work
  54. on breaking the Dynamic Substitution demo DYNSUB.PAS posted here
  55. last year.  Using the Turbo internal LCG RNG, without a message
  56. key, and just a single level of Dynamic Substitution, an attack
  57. should be far easier, and may demonstrate methods which could be
  58. used on the larger system.  
  59.  
  60.  
  61.  
  62.  
  63.                           CLOAK DESIGN THEORY
  64.  
  65.                              Terry Ritter
  66.                               26 Oct 1990
  67.  
  68.  
  69. CLOAK was designed to be a strong cipher.  Of course, most cipher
  70. programs produce ciphertext which seems to be complex, but very few
  71. available ciphers could be expected to win a confrontation with
  72. professional cryptanalysts and their fast computers.  
  73.  
  74. CLOAK was designed to be as simple as possible, so that the design
  75. could be fully revealed.  The usual practice is to invent a
  76. "proprietary" cipher, and keep the design secret.  What this really
  77. means is that serious cryptanalysts will know the design, while
  78. buyers and users will not; a strange situation indeed.  
  79.  
  80. At this point in the public development of cryptography, there is
  81. still no practical cipher which is provably secret.  Since the
  82. design of CLOAK is open to examination, each expert may come to
  83. their own conclusion as to its strength.  
  84.  
  85.  
  86. STREAM CIPHERS
  87.       CLOAK is an example of a stream cipher.  The classical Vernam
  88. stream cipher simply combines plaintext data with the output from
  89. a random number generator in an additive combiner, which is often
  90. a single exclusive-OR gate or XOR operation.  
  91.  
  92. Unfortunately, additive combiners are inherently susceptible to
  93. "known plaintext" attacks.  Moreover, most random number generators
  94. have only a tiny amount of internal state, and are easy to break. 
  95. Such a system is really a "toy" cipher.  
  96.  
  97. CLOAK improves upon the classical stream cipher design with a
  98. completely new class of cryptographic combiner (patent pending), a
  99. very large cryptographic random number generator, and "really
  100. random" message keys.  
  101.  
  102. Alternative design approaches include DES, which is now rather
  103. small, and RSA, which is slow and complex.  Public-key systems may
  104. seem to improve the key-distribution situation, but they also
  105. forego the inherent source verification of a secret-key system. 
  106. This can be overcome only with complex and precise protocols, thus
  107. adding even more complexity to the system.  
  108.  
  109. CLOAK is a secret-key system, which means that it is necessary to
  110. somehow get the secret key to the far end, so that enciphered
  111. messages may be deciphered.  However, once this is done, only those
  112. possessing the secret key may cipher messages in that key.  A
  113. secret-key system thus mimics the use of a house key, and has
  114. similar problems and risks.  
  115.  
  116.  
  117. DYNAMIC SUBSTITUTION COMBINER
  118.       The new cryptographic combiner can be described as an
  119. extension of classical Simple Substitution.  In simple
  120. substitution, each plaintext data value is translated into a
  121. ciphertext value using a substitution table.  The innovation of
  122. Dynamic Substitution is to re-arrange the content of the
  123. substitution table after every substitution operation.  In this
  124. case, the just-used substitution is exchanged with some
  125. substitution selected at random.  
  126.  
  127. The result is a non-linear combiner with a substantial amount of
  128. internal state.  Only non-linear combiners make sense when several
  129. are used in sequence; linear additive combiners do not.  
  130.  
  131. In CLOAK, I have used a two-level Dynamic Substitution design.  The
  132. first level randomizes the incoming data, and the second level has
  133. 16 separate combiners selected for use at random.  Because the
  134. second-level combiners are used at random, it should be difficult
  135. for a cryptanalyst to work on the content of any particular
  136. substitution table.  
  137.  
  138. Dynamic Substitution technology is patent-pending.  
  139.  
  140.  
  141. CRYPTOGRAPHIC RANDOM NUMBER GENERATOR
  142.       The usual computer-language random number generator (RNG) is
  143. a 32-bit linear congruential generator (LCG), and can be solved
  144. very easily given one, or perhaps a few of the random values.  This
  145. is a very weak cryptographic design.  
  146.  
  147. The generator I selected for use in CLOAK is the Additive RNG, as
  148. discussed in Knuth II.  
  149.  
  150. The strength of an RNG is at least partially related to the amount
  151. of its internal state, and the ones designed for statistical
  152. service are rather small.  But the Additive generator is easily
  153. customized, and can be made one or more bytes wide.  For CLOAK, the
  154. width has been set at 32 bits.  
  155.  
  156. The Additive generator can also be made as long as desired,
  157. provided that one can find primitive mod 2 polynomials of large
  158. degree.  For CLOAK primitives have been found at degrees 1279, 4253
  159. and 11213.  Thus, the amount internal state can be 11213 times as
  160. large as the usual computer language LCG RNG.  
  161.  
  162. There are billions of acceptable polynomials; the particular ones
  163. selected for use in CLOAK are protected by copyright.  
  164.  
  165.  
  166. JITTERIZER
  167.       Despite its size, the Additive generator is nonetheless a
  168. linear system, and thus "easily" solved (assuming a cyptanalyst
  169. gets past the combiners).  Naturally, the manipulation of 11,000
  170. equations in 11,000 unknowns of 32-bits each might be expected to
  171. slow cryptanalysis somewhat.  Nevertheless, it is still necessary
  172. to add some sort of isolation mechanism to hide the true sequence
  173. from analysis.  
  174.  
  175. For CLOAK, I have devised a mechanism which periodically deletes
  176. some of the Additive RNG result values from the output stream.  A
  177. random number of values are deleted after a random number of steps. 
  178. In addition, each group of values is given a separate value offset. 
  179. This should make cryptanalysis a real exercise; certainly the
  180. jitterizer cannot be expected to make cryptanalysis any easier.  
  181.  
  182.  
  183. THE MESSAGE KEY
  184.       An RNG will produce a particular sequence of random numbers
  185. after being initialized from a particular key.  Thus, when the
  186. usual stream cipher is used twice with the same key, the messages
  187. will be combined with the same sequence.  But one of the properties
  188. of additive combiners is that repeated sequences can "canceled
  189. out," thus leaving a combination of two plaintext messages.  Such
  190. a combination is likely to be broken easily.  
  191.  
  192. Consequently, it is important that the same sequence not be used
  193. for each message.  This could be done, for example, by having a
  194. different User Key for each message.  But this is surely
  195. unacceptable, for who could remember that many keys?  Who could
  196. transfer that many keys to the far end with any degree of secrecy? 
  197.  
  198. An alternative is to use a different key for each message, but do
  199. so only internally.  Each Message Key is enciphered and included in
  200. the message header; the User Key is used to encipher and thus
  201. protect the message key.  
  202.  
  203. Each message key is a "really random" value which is created
  204. dynamically for each message.  Because the message key is a truly
  205. arbitrary value, and since most cryptanalysis methods require that
  206. a message "make sense," an enciphered message key will be very
  207. difficult to crack.  
  208.  
  209. Another advantage of the message key is that it can be made quite
  210. large, as well as random.  CLOAK uses a message key consisting of
  211. 31 values of 32 bits each; a 124-byte message key (992 bits).  This
  212. is enough to directly initialize a degree-31 Additive RNG, which is
  213. then stepped until enough data are produced for a degree-127 RNG,
  214. etc.  Thus, the "really random" message key automatically satisfies
  215. many of the questions about a statistically correct initialization
  216. of the RNG.  It also reduces the need for extreme length in the
  217. user key.   
  218.  
  219.  
  220. THE USER KEY
  221.       Although the User Key is used only to protect the message key,
  222. it must initialize an RNG in order to do so.  This initialization
  223. should be as arbitrary as possible.  I decided to use LFSR or CRC
  224. technology to perform a polynomial division of the textual key, and
  225. use remainders as the initialization value.  
  226.  
  227. The user key is processed by 32 degree-31 polynomials, thus
  228. producing 32 different results of 31 bits each.  By eliminating the
  229. unused bits, 31 values of 32 bits each are produced; this is
  230. exactly the right amount of data to initialize a degree-31 Additive
  231. RNG.  By stepping the Additive RNG, it will eventually fill enough
  232. to initialize a degree-127 RNG, and so on.  
  233.  
  234. CLOAK collects the user key from the keyboard into a string with a
  235. maximum length of 255 bytes; thus, up to 2040 bits of randomness
  236. are collected.  This is then reduced (or expanded) to the 992 bits
  237. needed for degree-31 Additive RNG initialization.  CLOAK does not
  238. insist on a long user key, but the serious user will create very
  239. unique keys of 30 characters or longer.  
  240.  
  241. There are millions of acceptable degree-31 primitive mod 2
  242. polynomials; the particular ones selected for CLOAK are protected
  243. by copyright.  
  244.  
  245.  
  246.  
  247. SELECTED BIBLIOGRAPHY
  248.       .  Beker, H. and F. Piper.  1982.  Cipher Systems.  John
  249. Wiley: New York.
  250.       .  Blum, L., M. Blum and M. Shub.  1986.  A Simple
  251. Unpredictable Pseudo-Random Number Generator.  SIAM Journal of
  252. Computing.  15: 364-383.  
  253.       .  Chaitin, G.  1975.  Randomness and mathematical proof. 
  254. Scientific American.  232(5): 47-52.  
  255.       .  Ciarcia, S.  1986.  Build a Hardware Data Encryptor. 
  256. Byte.  Sept: 97-111.  
  257.       .  Devours, C., D. Kahn, L. Kruh, G. Mellen, B. Winkel.
  258. 1987.   Cryptology Yesterday, Today, and Tomorrow.  Artech House: 
  259. Norwood, MA.  
  260.       .  Geffe, P.  1973.  How to protect data with ciphers that
  261. are really hard to break.  Electronics.  46(1): 99-101.  
  262.       .  Golomb, S.  1982 (original 1967).  Shift Register
  263. Sequences.  Aegean Park Press:  POB 2837, Laguna Hills, CA 92653. 
  264.       .  Kahn, D.  1967.  The Codebreakers.  Macmillan: New York. 
  265.       .  Knuth, D.  The Art of Computer Programming, Vol. 2,
  266. Seminumerical Algorithms.  2nd ed.  Addison-Wesley: Reading,
  267. Massachusetts.  
  268.       .  Kochanski, M.  1987.  A Survey of Data Insecurity
  269. Packages.  Cryptologia.  XI(1): 1-15.  
  270.       .  Kochanski, M.  1988.  Another Data Insecurity Package. 
  271. Cryptologia.  XII(3): 165-173.  
  272.       .  L'Ecuyer, P. and R. Proulx.  1989.  About Polynomial-
  273. Time "Unpredictable" Generators.  Proceedings of the 1989 Winter
  274. Simulation Conference.  467-476.  
  275.       .  Lu, S.  1979.  The Existence of Good Cryptosystems for
  276. Key Rates Greater than Message Redundancy.  IEEE Transactions on
  277. Information Theory.  IT-25(4): 475-477.  
  278.       .  MacWilliams, F. and N. Sloane.  1977.  The Theory of
  279. Error-Correcting Codes.  North Holland:  Amsterdam / New York.  
  280.       .  Marsaglia, G.  1984.  A current view of random number
  281. generators.  Proceedings of the Sixteenth Symposium on the
  282. Interface Between Computer Science and Statistics.  3-10.  
  283.       .  Marsaglia, G. and L. Tsay.  1985.  Matrices and the
  284. Structure of Random Number Sequences.  Linear Algebra and its
  285. Applications.  67: 147-156.  
  286.       .  Pearson, P.  1988.  Cryptanalysis of the Ciarcia
  287. Circuit Cellar Data Encryptor.  Cryptologia.  12: 1-10.  
  288.       .  Plauger, P.  1988.  Locking the Barn Door.  Computer
  289. Language.  October, 17-22.  
  290.       .  Retter, C.  1984.  Cryptanalysis of a Maclaren-
  291. Marsaglia System.  Cryptologia.  8(2): 97-108.  (Also see 8(4):
  292. 374-378.)  
  293.       .  Retter, C.  1985.  A Key-Search Attack on Maclaren-
  294. Marsaglia Systems.  Cryptologia.  9(2): 114-130.  
  295.       .  Ritter, T.  1990.  Substitution Cipher with Pseudo-
  296. Random Shuffling:  The Dynamic Substitution Combiner.  Cryptologia. 
  297. XIV(4): 289-303.  
  298.       .  Siegenthaler, T.  1985.  Decrypting a Class of Stream
  299. Ciphers Using Ciphertext Only.  IEEE Transactions on Computers. 
  300. C-34(1): 81-85.  
  301.       .  Vahle, M. and L. Tolendino.  1982.  Breaking a Pseudo
  302. Random Number Based Cryptographic Algorithm.  Cryptologia.  6(4):
  303. 319-328.  
  304.       .  Wolfram, S.  1986.  Random Sequence Generation by
  305. Cellular Automata.  Advances in Applied Mathematics.  7: 123-169. 
  306.